package com.zaxxer.hikari.pool;

import lombok.extern.slf4j.Slf4j;

import java.sql.Connection;

@Slf4j
public class CafProxyConnection {
    public static void closeProxyConnection(ProxyConnection con){
        PoolEntry poolEntry = con.getPoolEntry();
        Connection realCon = poolEntry.connection;

        try{
            realCon.close();
        }catch (Throwable e){
            log.error(e.getStackTrace().toString());
            throw new RuntimeException("Cannot close Hikari real Connection!");
        }
    }
}
